<link href="/assets/js/validate/jquery.validate.css" type="text/css" rel="stylesheet" />
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/jquery.validate.min.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/additional-methods.min.js" type="text/javascript"></script>
<script type="text/javascript">
	$(function(){
		$("#inputForm").validate({
		    errorPlacement: function(error, element) {
		        if (element.attr("name") == "terms" )
		        	error.insertAfter("#termsError");
		        else
		        	error.insertAfter(element);
		    },
		    submitHandler: function(form) {
		        ShowMsg();
		        form.submit();
		    }, 
		    rules: {
				email: {
					required: true,
					email: true,
					minlength: 4,
					maxlength: 127,
					remote: {
						url: "/ajax/CheckUser/notexist",
						type: "post",
						email: function() {
							return $("#email").val();
						}
					}
				},
		    	password_confirm:{
					equalTo:"#password"
		    	},
		    	terms:'required'
			},
			messages : {
				email: {
					required: "请填写您的Email",
					email: "请填写正确的邮箱",
					remote: "此邮箱已注册,建议您换一个"
				},
				password_confirm : {
					equalTo:"Please enter the password value again."
				},
				terms:"You must agree to terms and conditions of service."
			}
		});
	});

</script>
<div id="page" class="wrapper w_960 clearfix">
  <h2 class="heading">注册</h2>
  <p class="description">免费获得一个账户!</p>
  <div id="content" class="col first_col b1">
    <form id="inputForm" action="/user/signup/regSave" method="post">
      <div class="row clearfix">
        <label for="email">邮箱* :</label>
        <p><span class="error">
          <input id="email" name="email" class="inputs med" type="text" value="">
          </span></p>
      </div>
      <div class="row clearfix">
        <label for="password">密码* :</label>
        <p><span>
          <input id="password" name="password" class="inputs med required {validate:{maxlength:20,minlength:6}}" type="password" value="" maxlength="20">
          </span></p>
      </div>
      <div class="row clearfix">
        <label for="password">确认密码* :</label>
        <p><span>
          <input type="password" name="password_confirm" maxlength="20" id="password_confirm" class="inputs med required">
          </span></p>
      </div>
      <div class="row clearfix">
        <p id="termsError">
          <input type="checkbox" name="terms" checked="checked" id="terms" class="inputs checkbox">
          <label for="terms" class="normal">已阅读并同意以下 <a target="_blank" href="/info/terms">协议</a></label>
        </p>
      </div>
      <div class="row clearfix">
        <input type="submit" name="submitBtn" id="submitBtn" class="submit" value="Register">
        <a href="/user/login" class="second_opt">已拥有账户?</a> </div>
    </form>
  </div>
</div>
